<?php
session_start();
include("../service/userService.php");
include("../util/constant.php");

$newPassword = $_POST["newPassword"];

if(updateAdminPassword($_SESSION['usernameAdmin'][2], md5($newPassword))){
    echo "<script>window.location.href='../admin/change-password.php?a=".UPDATE_SUCCESSFULLY."';</script>";
} else {
    echo "<script>window.location.href='../admin/change-password.php?a=".UPDATE_FAILED."';</script>";
}
?>